/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ambimmort.prserver.bean;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.Objects;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 定巍
 */
@XmlRootElement(name = "PolicyBean")
@DatabaseTable(tableName = "SVNFILE")
public class SVNFileBean implements Comparable<SVNFileBean> {

    @DatabaseField(generatedId = true)
    private long id;
    @DatabaseField(index = true)
    private int messageNo = 1;

    @DatabaseField(dataType = DataType.LONG_STRING)
    private String content;

    @DatabaseField(dataType = DataType.STRING)
    private String comment;

    @DatabaseField(defaultValue = "false", canBeNull = false, index = true)
    private boolean isNewest;

    @DatabaseField(defaultValue = "false", canBeNull = false, index = true)
    private boolean isDeleted;

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public boolean isNewest() {
        return isNewest;
    }

    public void setNewest(boolean isNewest) {
        this.isNewest = isNewest;
    }

    public boolean isIsNewest() {
        return isNewest;
    }

    public void setIsNewest(boolean isNewest) {
        this.isNewest = isNewest;
    }

    public boolean isIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getMessageNo() {
        return messageNo;
    }

    public void setMessageNo(int messageNo) {
        this.messageNo = messageNo;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "SVNFile{" + "id=" + id + ", messageNo=" + messageNo + ", content=" + content + ", isNewest=" + isNewest + ", isDeleted=" + isDeleted + '}';
    }

    @Override
    public int compareTo(SVNFileBean o) {
        return (int) (this.id - o.id);
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 89 * hash + (int) (this.id ^ (this.id >>> 32));
        hash = 89 * hash + this.messageNo;
        hash = 89 * hash + Objects.hashCode(this.content);
        hash = 89 * hash + Objects.hashCode(this.comment);
        hash = 89 * hash + (this.isNewest ? 1 : 0);
        hash = 89 * hash + (this.isDeleted ? 1 : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final SVNFileBean other = (SVNFileBean) obj;
        if (this.id != other.id) {
            return false;
        }
        if (this.messageNo != other.messageNo) {
            return false;
        }
        if (!Objects.equals(this.content, other.content)) {
            return false;
        }
        if (!Objects.equals(this.comment, other.comment)) {
            return false;
        }
        if (this.isNewest != other.isNewest) {
            return false;
        }
        if (this.isDeleted != other.isDeleted) {
            return false;
        }
        return true;
    }
    
    

}
